<template>
  <div class="Child">
    <h2 ref="title">
      子模块
    </h2>
    <button @click="onChange">子模块：调节水温</button>
  </div>
</template>

<script lang="ts" setup name="Child">
import {reactive,ref,watch, defineExpose} from 'vue'

let title= ref();
let name =ref('孩子');
let age = ref(88)


defineExpose({name,age}) //将数据暴露出去

function onChange() {
  console.log(title.value);
  
}


</script>